package com.ruoyi.common.utils;

import org.apache.commons.codec.digest.DigestUtils;
import java.io.IOException;
import java.io.InputStream;

/**
 *<p> 摘要算法工具</p>
 * @author cc
 * @version 1.0
 * @since 1.0
 * */
public class Md5Util {
    public static String toMd5String(String input) {
        return DigestUtils.md5Hex(input);
    }

    public static String md5Abstract(InputStream input) {
        try {
            return DigestUtils.md5Hex(input);
        } catch (IOException e) {
            return null;
        }
    }
}
